xenpaging: when populating a page, check if populating is already in progress
authorKeir Fraser <keir@xen.org>
Fri, 26 Nov 2010 14:21:33 +0000 (14:21 +0000)
committerKeir Fraser <keir@xen.org>
Fri, 26 Nov 2010 14:21:33 +0000 (14:21 +0000)
commit55121cdb79403ef434712b6b09eab105e1bca897
tree81e20af0bb8332f5e772b8a97d0a6f04af349065
parentcbf6a23dab0c7eba0b1348c87978b3725ea07df1
xenpaging: when populating a page, check if populating is already in progress

p2m_mem_paging_populate can be called serveral times from different
vcpus. If the page is already in state p2m_ram_paging_in and has a new
valid mfn, invalidating this new mfn will cause trouble later if
p2m_mem_paging_resume will set the new gfn/mfn pair back to state
p2m_ram_rw.  Detect this situation and keep p2m state if the page is
in the process of being still paged-out or already paged-in.  In fact,
p2m state p2m_ram_paged is the only state where the mfn type can be
invalidated.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
xen/arch/x86/mm/p2m.c